home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2007 April / CM 04-2007 CD2.iso / cdmenu / modules / menu.dat / scripts / %3Cdefault package%3E / GWListItemClass.as < prev   
Encoding:
Text File  |  2006-01-15  |  2.3 KB  |  68 lines

  1. _global.GWListItemClass = function(o)
  2. {
  3.    super.init();
  4.    this.init();
  5. };
  6. GWListItemClass.prototype = new GWLabelClass();
  7. Object.registerClass("GWListItemClass",GWListItemClass);
  8. GWListItemClass.prototype.init = function()
  9. {
  10.    this.basecolor_on = this.basecolor_on != undefined ? this.basecolor_on : 664682;
  11.    this.basecolor_off = this.basecolor_off != undefined ? this.basecolor_off : 16777215;
  12.    this.basecolor_over = this.basecolor_over != undefined ? this.basecolor_over : 16777215;
  13.    this.fontcolor_on = this.fontcolor_on != undefined ? this.fontcolor_on : 16777215;
  14.    this.fontcolor_off = this.fontcolor_off != undefined ? this.fontcolor_off : 0;
  15.    this.fontcolor_over = this.fontcolor_over != undefined ? this.fontcolor_over : 0;
  16.    this.width = Math.round(this.width || this._width);
  17.    this.height = Math.round(this.height || this._height);
  18.    this._xscale = this._yscale = 100;
  19.    this.drawBox("base_mc",2,0,0,1,1,this.basecolor_off,100);
  20.    this.base_mc._alpha = this.alpha != undefined ? this.alpha : 100;
  21.    this.setSize(this.width,this.height);
  22.    this.setLabel(this.label);
  23.    this.setIcon(this.icon);
  24.    this.pady = 0;
  25.    this.useHandCursor = false;
  26. };
  27. GWListItemClass.prototype.setData = function(d)
  28. {
  29.    this.data = d;
  30. };
  31. GWListItemClass.prototype.getData = function()
  32. {
  33.    return this.data;
  34. };
  35. GWListItemClass.prototype.setIcon = function(i)
  36. {
  37.    if(i.length)
  38.    {
  39.       this.attachMovie(i,"icon_mc",3,{_x:4});
  40.       if(this.icon_mc._height > this.height)
  41.       {
  42.          this.sizeMe(this.icon_mc._width * (this.height / this.icon_mc._height),this.height,this.icon_mc);
  43.       }
  44.       this.setLabelPlacement("right");
  45.    }
  46. };
  47. GWListItemClass.prototype.setSize = function(w, h)
  48. {
  49.    if(!this.label_mc)
  50.    {
  51.       this.createEmptyMovieClip("label_mc",500);
  52.       this.drawBox("mask_mc",501,0,0,this.width - this.padx,this.height - this.pady,0,0);
  53.    }
  54.    this.width = this.base_mc._width = w;
  55.    this.height = this.base_mc._height = h;
  56.    this.mask_mc._width = w - this.padx * 3;
  57.    this.mask_mc._height = h - this.pady * 2;
  58.    if(this.labelAlign == "center")
  59.    {
  60.       this.label_mc._x = Math.round((this.width - this.label_mc._width) / 2);
  61.    }
  62. };
  63. GWListItemClass.prototype.setBaseColor = function(c)
  64. {
  65.    var _loc2_ = new Color(this.base_mc);
  66.    _loc2_.setRGB(c);
  67. };
  68.